package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;

/**
 * @projectName: gp2022
 * @package: cn.cau.epidemicsurveysystem.bean
 * @className: EpidTemplateQuestionBean
 * @author: Eric
 * @description: TODO
 * @date: 2022/2/28 17:06
 * @version: 1.0
 */
@Entity
@Table(name = "epidTemplateQuestion", schema = "gp2022", catalog = "")
public class EpidTemplateQuestionBean {
    private int epidTemplateQuestionId;
    private Integer questionType; //0 1 2
    private String questionName;
    private Integer optionNum;
    private int epidTemplateId;
    private Integer questionPos;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "epidTemplateQuestionId")
    public int getEpidTemplateQuestionId() {
        return epidTemplateQuestionId;
    }

    public void setEpidTemplateQuestionId(int epidTemplateQuestionId) {
        this.epidTemplateQuestionId = epidTemplateQuestionId;
    }

    @Basic
    @Column(name = "questionType")
    public Integer getQuestionType() {
        return questionType;
    }

    public void setQuestionType(Integer questionType) {
        this.questionType = questionType;
    }

    @Basic
    @Column(name = "questionName")
    public String getQuestionName() {
        return questionName;
    }

    public void setQuestionName(String questionName) {
        this.questionName = questionName;
    }

    @Basic
    @Column(name = "optionNum")
    public Integer getOptionNum() {
        return optionNum;
    }

    public void setOptionNum(Integer optionNum) {
        this.optionNum = optionNum;
    }

    @Basic
    @Column(name = "epidTemplateId")
    public int getEpidTemplateId() {
        return epidTemplateId;
    }

    public void setEpidTemplateId(int epidTemplateId) {
        this.epidTemplateId = epidTemplateId;
    }

    @Basic
    @Column(name = "questionPos")
    public Integer getQuestionPos() {
        return questionPos;
    }

    public void setQuestionPos(Integer questionPos) {
        this.questionPos = questionPos;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EpidTemplateQuestionBean that = (EpidTemplateQuestionBean) o;

        if (epidTemplateQuestionId != that.epidTemplateQuestionId) return false;
        if (epidTemplateId != that.epidTemplateId) return false;
        if (questionType != null ? !questionType.equals(that.questionType) : that.questionType != null) return false;
        if (questionName != null ? !questionName.equals(that.questionName) : that.questionName != null) return false;
        if (optionNum != null ? !optionNum.equals(that.optionNum) : that.optionNum != null) return false;
        if (questionPos != null ? !questionPos.equals(that.questionPos) : that.questionPos != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = epidTemplateQuestionId;
        result = 31 * result + (questionType != null ? questionType.hashCode() : 0);
        result = 31 * result + (questionName != null ? questionName.hashCode() : 0);
        result = 31 * result + (optionNum != null ? optionNum.hashCode() : 0);
        result = 31 * result + epidTemplateId;
        result = 31 * result + (questionPos != null ? questionPos.hashCode() : 0);
        return result;
    }
}
